package com.wash.shoes.controller.mobile;


import com.ruoyi.common.core.domain.R;
import com.wash.shoes.domain.vo.CouponVo;
import com.wash.shoes.entity.CouponPo;
import com.wash.shoes.service.CouponService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author ljg
 * @since 2024-12-01
 */
@Api(tags = {"移动端-优惠卷"})
@RestController
@RequestMapping("/mobile-api/coupon")
public class CouponMController extends BaseMController {

    @Autowired
    CouponService couponService;

    @ApiOperation("首页显示的优惠卷列表")
    @PostMapping("/showCouponList")
    public R<List<CouponVo>> showCouponList(String customerId,String channel) {
        List<CouponVo> dataList = couponService.showCouponList(customerId,channel);
        return R.ok(dataList);
    }

    @ApiOperation("获取详情")
    @PostMapping("/getDetailById")
    public R<CouponPo> getDetailById(String theId) {
        CouponPo couponPo = couponService.getById(theId);
        return R.ok(couponPo);
    }

}

